<!DOCTYPE html>
<html>
<head>

<script type="text/javaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://www.wilsea.com/ckeditor/ckeditor.js"></script>

</head>
<body>
        <textarea id="editor1" name="editor1" rows="10" cols="80">
           
        </textarea>

<script>
function myFunction()
{
var data = CKEDITOR.instances.editor1.getData();
alert(data);    


CKEDITOR.instances.textarea.on( 'instanceReady', function( instanceReadyEventObj )
{
var editorInstanceData = CKEDITOR.instances.editor1.getData();
alert( editorInstanceData );
});


}
CKEDITOR.replace( 'editor1' );
</script>


<button onclick="myFunction()">Click me</button>

<p id="demo"></p>

</body>
</html>